package lntu.r212.gc;

public class Student {
    private String name;
    private int age;
    //每一个类，系统都会分配一个无参数的构造函数,若定义有参构造函数，系统就不提供了
    //构造函数-->[修饰符] Student(){} 构造函数名必须和类名一致；构造函数没有返回值

    public Student(){

    }
    public Student(String name){
        this.name = name;
    }
    public Student(String name,int age){
        this.name = name;
        this.age = age;
    }
    public void setName(String name){
        this.name = name;
    }
    public String getName(){
        return name;
    }
    public void setAge(int age){
        this.age = age;
    }
    public int getAge(){
        return age;
    }
}
